package com.mathdroid.model.abilities.specs.sniper;

import com.mathdroid.model.abilities.Ability;
import com.mathdroid.model.enums.EDmgType;

public final class Takedown extends Ability {

	/**
	 * Generated UID.
	 */
	private static final long serialVersionUID = 7417230099521147965L;

	public Takedown() {
		this.setName("Takedown");
		this.setIconName("imperialagent");
		this.setResource("Energy");
		this.setCost(15d);
		this.setCooldownMs(12000d);
		this.setDirectDamageType(EDmgType.ENERGY);
		
		this.setStandardHealthPercentMax(0.27);
		this.setStandardHealthPercentMin(0.27);	
		this.setAmountModifierPercent(0.8);
		this.setCoefficient(2.7);
		
		this.setTrainableLevel(18);
	}
	
	@Override
	public String getDescription() {
		return "Attempts to take the target down with a single " +
			"powerful shot that deals " + this.getMinDirect() + " - " 
			+ this.getMaxDirect() + " weapon damage. " +
			"Only usable on targets at or below 30% max health.";
	}

	@Override
	public double getMinPeriodic() {
		return 0d;
	}

	@Override
	public double getMaxPeriodic() {
		return 0d;
	}

	@Override
	public double getMinDirect() {
		return
			this.getAmountModifierPercent() 
			* this.getCharStats().getRangedDamagePrimaryMin()
		
			+ this.getCoefficient() 
			* this.getCharStats().getTotalBonusDamageTechForce()
		
			+ this.getStandardHealthPercentMin() 
			* this.getStdDmg();
	}

	@Override
	public double getMaxDirect() {
		return 
			this.getAmountModifierPercent()
			* this.getCharStats().getRangedDamagePrimaryMax()
			
			+ this.getCoefficient() 
			* this.getCharStats().getTotalBonusDamageTechForce()
			
			+ this.getStandardHealthPercentMax() 
			* this.getStdDmg();
	}
}
